/*******************************************************************************
 *                                                                             *
 * Square3D Engine                                                             *
 * (C) 2010 Aviral Dasgupta <aviraldg@gmail.com>                               *
 *                                                                             *
 *******************************************************************************
 * Vec3.cpp                                                                    *
 ******************************************************************************/

template <typename T>
Vec3<T>::Vec3(T a, T b, T c)
{
	this->data[0] = a;
	this->data[1] = b;
	this->data[2] = c;
}

template <typename T>
Vec3<T> &Vec3<T>::operator=(Vec3<T> &other)
{
	this->data[0] = other[0];
	this->data[1] = other[1];
	this->data[2] = other[2];
	return *this;
}

/* Warning it is the user's job to ensure a valid index!
 * XXX FIXME TODO
 */
template <typename T>
inline T Vec3<T>::operator[](unsigned int index)
{
	assert(index < 3);
	return this->data[index];
}

